]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tray: Get rid of deprecation warnings
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 25 Sep 2015 22:21:05 +0000 (00:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 15 Oct 2015 21:05:11 +0000 (23:05 +0200)
gdk_window_set_composited() is deprecated, and we don't need it as
we end up setting it to the default anyway.
We do need gtk_widget_set_double_buffered() though, which has been
deprecated as well because it is only meaningful on X11 - but so
is XEmbed, so just shut up that warning.

src/shell-tray-manager.c
src/tray/na-tray-child.c
src/tray/na-tray-child.h

index 3625b9edfa942cedd8b2fea7102e3ecb31a17cb1..a1a6b3a0c2466fdba3556fa85ac738531672c3ad 100644 (file)
@@ -279,14 +279,6 @@ na_tray_icon_added (NaTrayManager *na_manager, GtkWidget *socket,
   GtkWidget *win;
   ShellTrayManagerChild *child;
 
-  /* We don't need the NaTrayIcon to be composited on the window we
-   * put it in: the window is the same size as the tray icon
-   * and transparent. We can just use the default X handling of
-   * subwindows as mode of SOURCE (replace the parent with the
-   * child) and then composite the parent onto the stage.
-   */
-  na_tray_child_set_composited (NA_TRAY_CHILD (socket), FALSE);
-
   win = shell_embedded_window_new ();
   gtk_container_add (GTK_CONTAINER (win), socket);
 
index b625ab9c51757a3156aca2fd1d947942105255b9..e363fd1e29ca5e0bd69caeb89a24477c336f1c23 100644 (file)
@@ -53,7 +53,6 @@ na_tray_child_realize (GtkWidget *widget)
       /* Set a transparent background */
       cairo_pattern_t *transparent = cairo_pattern_create_rgba (0, 0, 0, 0);
       gdk_window_set_background_pattern (window, transparent);
-      gdk_window_set_composited (window, TRUE);
       cairo_pattern_destroy (transparent);
 
       child->parent_relative_bg = FALSE;
@@ -72,17 +71,19 @@ na_tray_child_realize (GtkWidget *widget)
       child->parent_relative_bg = FALSE;
     }
 
-  gdk_window_set_composited (window, child->composited);
-
   gtk_widget_set_app_paintable (GTK_WIDGET (child),
                                 child->parent_relative_bg || child->has_alpha);
 
   /* Double-buffering will interfere with the parent-relative-background fake
    * transparency, since the double-buffer code doesn't know how to fill in the
    * background of the double-buffer correctly.
+   * The function is deprecated because it is only meaningful on X11 - the
+   * same is true for XEmbed of course, so just ignore the warning.
    */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   gtk_widget_set_double_buffered (GTK_WIDGET (child),
                                   child->parent_relative_bg);
+G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
 static void
@@ -285,8 +286,6 @@ na_tray_child_new (GdkScreen *screen,
   visual_has_alpha = red_prec + blue_prec + green_prec < depth;
   child->has_alpha = visual_has_alpha;
 
-  child->composited = child->has_alpha;
-
   return GTK_WIDGET (child);
 }
 
@@ -362,33 +361,6 @@ na_tray_child_has_alpha (NaTrayChild *child)
   return child->has_alpha;
 }
 
-/**
- * na_tray_child_set_composited;
- * @child: a #NaTrayChild
- * @composited: %TRUE if the child's window should be redirected
- *
- * Sets whether the #GdkWindow of the child should be set redirected
- * using gdk_window_set_composited(). By default this is based off of
- * na_tray_child_has_alpha(), but it may be useful to override it in
- * certain circumstances; for example, if the #NaTrayChild is added
- * to a parent window and that parent window is composited against the
- * background.
- */
-void
-na_tray_child_set_composited (NaTrayChild *child,
-                              gboolean     composited)
-{
-  g_return_if_fail (NA_IS_TRAY_CHILD (child));
-
-  if (child->composited == composited)
-    return;
-
-  child->composited = composited;
-  if (gtk_widget_get_realized (GTK_WIDGET (child)))
-    gdk_window_set_composited (gtk_widget_get_window (GTK_WIDGET (child)),
-                               composited);
-}
-
 /* If we are faking transparency with a window-relative background, force a
  * redraw of the icon. This should be called if the background changes or if
  * the child is shifted with respect to the background.
index eb4434f28ce7e9eece9c44f6761063b23f4e20c5..d1436764248b0620a5afcdb04395934daf8fdd53 100644 (file)
@@ -42,7 +42,6 @@ struct _NaTrayChild
   GtkSocket parent_instance;
   Window icon_window;
   guint has_alpha : 1;
-  guint composited : 1;
   guint parent_relative_bg : 1;
 };
 
@@ -57,8 +56,6 @@ GtkWidget      *na_tray_child_new            (GdkScreen    *screen,
                                               Window        icon_window);
 char           *na_tray_child_get_title      (NaTrayChild  *child);
 gboolean        na_tray_child_has_alpha      (NaTrayChild  *child);
-void            na_tray_child_set_composited (NaTrayChild  *child,
-                                              gboolean      composited);
 void            na_tray_child_force_redraw   (NaTrayChild  *child);
 void            na_tray_child_get_wm_class   (NaTrayChild  *child,
                                              char        **res_name,